//
//  CustomItemSpriteWithText.m
//  jumpingfrog
//
//  Created by Tri Vo on 8/19/13.
//  Copyright (c) 2013 Tri Vo. All rights reserved.
//

#import "CustomItemSpriteWithText.h"


@implementation CustomItemSpriteWithText

- (id)initwithNormalImage:(NSString *)ni andSelectedImage:(NSString *)si andDisableImage:(NSString *)di withText:(NSString *)text andFontSize:(int)fontSize withTarget:(id)target andSelector:(SEL)sel {
    if (self = [super initWithNormalSprite:[CCSprite spriteWithFile:ni] selectedSprite:[CCSprite spriteWithFile:si] disabledSprite:[CCSprite spriteWithFile:di] target:target selector:sel]) {
        textInside = [CCLabelTTF labelWithString:text fontName:@"Windsor" fontSize:fontSize];
        [textInside setPosition:CGPointMake(self.contentSize.width/2, self.contentSize.height/2)];
        [self addChild:textInside z:1]; 
    }
    return self;
}

- (NSString *)getResName {
    return _resName;
}

- (void)setText:(NSString *)text {
    [textInside setString:text];
}

- (void)dealloc {
    [super dealloc];
}
@end
